package com.blueocean_health.care.management.em;

import com.blueocean_health.care.management.common.base.string.StringUtils;

/**
 * @Author ChenPeng cp
 * @Date 2017/8/22 11:44
 * 订单类型
 */


public enum OrderTypeEnum {


    _1("1", "新入"),
    _2("2", "续费"),
    _3("3", "退款"),;



    private String key;
    private String val;

    OrderTypeEnum(String key, String val) {
        this.key = key;
        this.val = val;
    }

    public String getVal() {
        return val;
    }

    public String getKey() {
        return key;
    }
    
    /**
	 * 根据key值查value
	 * 
	 * @param value
	 * @return
	 */
	public static String ValOfKey(String key) {
		if (!StringUtils.isEmpty(key)) {
			OrderTypeEnum[] businessModeEnums = values();
			for (OrderTypeEnum businessModeEnum : businessModeEnums) {
				if (businessModeEnum.getKey().equals(key)) {
					return businessModeEnum.getVal();
				}
			}
		}
		return null;
	}


}